package com.example.quickstartconsumer.controller;

import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.samples.quickstart.dubbo.api.DemoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 韦兵
 * @since 2025/4/27 20:12
 */
@RestController
@RequestMapping("/consumer")
@Slf4j
public class ConsumerController {

    @DubboReference
    private DemoService demoService;

    @GetMapping("/test")
    public String test() {
        demoService.sayHello("我是调用者");
        log.info("我是消费者");
        return "我是调用者";
    }

}
